package filedemo;



public class RecursionDemo {
    public static void main(String[] args) {

        RecursionDemo recursionDemo = new RecursionDemo();
        System.out.println(recursionDemo.recursionTest(100));

    }

    public int  recursionTest(int number){
//        if (n<=number){
//            sum +=n;
//            n++;
//            recursionTest(number);
//        }
//        return sum;

        if (number <=0){
            return number;
        }else {
            return recursionTest(number-1)+number;
        }
    }
}
